package com.crowntit.domain.trade.model.valobj;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum TradeOrderStatusEnumVO {
    CREATE(0, "CREATE", "创建完成"),
    COMPLETE(1, "COMPLETE", "消费完成"),
    CLOSE(2, "CLOSE", "超时关单");

    private int code;
    private String desc;
    private String info;

    public static TradeOrderStatusEnumVO get(int code) {
        switch (code) {
            case 0:
                return CREATE;
            case 1:
                return COMPLETE;
            case 2:
                return CLOSE;
            default:
                return CREATE;
        }
    }
}
